<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">
	

<h:head>
	<title>三一 - 问卷调查</title>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../../js/highcharts.js"></script>
	<script type="text/javascript" src="../../js/drawChart.js"></script>
</h:head>

<h:body>
	<ui:param name="bean" value="#{auanyDisplayByChannelAction}" />
	
	<span class="pagetitle">实时数据 —— Auany统计概况</span>
	<p:separator />
	
	<!-- 右侧页面顶部查询部分 -->
	<h:form id="fsearch">
		<p:poll interval="20" listener="#{bean.search()}" update=":dform" />
	
		<p:growl id="growl" showDetail="true" sticky="false" life="1000"/>
		<h:outputLabel value="查看日期：" />
        <p:calendar value="#{bean.lookDate}" mode="popup" pattern="yyyy-MM-dd" />
        &#160;&#160;&#160;
        <p:commandButton value="查询" action="#{bean.search()}" update=":data" ajax="false" />
        &#160;&#160;&#160;
		<h:outputLabel style="font-size:10px" value="数据实时更新（只能查看最近7天数据），更新时间#{bean.lastUpdateTimeStr}" />
	</h:form>
	<br />

	<!-- 数据展示部分，包含表格和图表 -->
	<h:form id="dform">
		<div class="data" id="data">
			<p:panel id="panel1" header="Auany统计概况" style="margin-bottom:10px;">
                <h:commandLink rendered="#{bean.channelDatas != null and bean.channelDatas.size() > 0}">
                    <p:graphicImage url="/resources/images/excel.png" height="25px" />
                    <p:dataExporter type="xls" target="dlist1" fileName="AuanyByChannelFlow-#{pageHelper.getNewDateDetailStr()}" />
                </h:commandLink>
				<p:dataTable id="dlist1" var="l" value="#{bean.channelDatas}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
					<p:column headerText="渠道" styleClass="column grcnewUser" sortBy="#{pageHelper.getChannelNameById(l.channelid)}">
						<h:outputLabel value="#{pageHelper.getChannelNameById(l.channelid)}" />
					</p:column>
					<p:column headerText="新增" styleClass="column grcnewUser" sortBy="#{l.newUser}">
						<h:outputLabel value="#{l.newUser}" />
					</p:column>
					<p:column headerText="活跃    " styleClass="column grcnewUser" sortBy="#{l.activeUser}">
						<h:outputLabel value="#{l.activeUser}" />
					</p:column>
					<p:column headerText="付费帐号" styleClass="column grcnewUser" sortBy="#{l.payUser}">
						<h:outputLabel value="#{l.payUser}" />
					</p:column>
					<p:column headerText="付费金额#{pageHelper.getMoneyType()}" styleClass="column grcnewUser" sortBy="#{l.pay}">
						<h:outputLabel value="#{l.pay}" />
					</p:column>
				</p:dataTable>
			</p:panel>
		</div>
	</h:form>

	<div class="footer"></div>
</h:body>
</html>